home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8218 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  57 lines

  1. Path: in1.uu.net!tandem!gautam
  2. From: gautam@everest.tandem.com (vallabha_gautam)
  3. Newsgroups: comp.lang.c++
  4. Subject: Flattening a class hierarchy
  5. Followup-To: comp.lang.c++
  6. Date: 15 Feb 1996 20:35:56 GMT
  7. Organization: Tandem Computers, Inc.
  8. Sender: gautam@nskernel.tandem.com
  9. Distribution: world
  10. Message-ID: <4g05fc$df0@gazette.tandem.com>
  11. NNTP-Posting-Host: knight.nskernel.tandem.com
  12.  
  13. Hi.
  14.  
  15. I am looking for a tool that will do the following -
  16.  
  17.  Given a set of C++ header files, extract the structure
  18.  layout of each class, and maybe display it as a C structure.
  19.  For example, with two C++ classes
  20.  
  21.     class myrootclass {
  22.        int x;
  23.        int y;
  24.      }
  25.  
  26.     class myderivedclass : myrootclass {
  27.         int z;
  28.      }
  29.  
  30.  The program should translate it to the following, say, C structures.
  31.  
  32.    struct myrootclass {
  33.        int x;
  34.        int y;
  35.     }
  36.  
  37.    struct myderivedclass {
  38.        int x;  // these two variables are
  39.        int y;  // from myrootclass
  40.        int z;
  41.     }
  42.  
  43. The reason we need it is to look at memory dumps - it the
  44. dump analyzer/debugger does not understand C++, it becomes 
  45. a major pain to trace through and find the offsets of the 
  46. elements of the class. Is it possible to use 'cfront' to 
  47. do the job described above?
  48.  
  49. thanks in advance,
  50. --gautam
  51.  
  52.   
  53. p.s: I did look through the newsgroup FAQ, and searched
  54.  through some C++ home pages, but could not find anything.
  55.  
  56.  
  57.